package com.jungle.bfi.service.biz.impl;

import com.github.dozermapper.core.Mapper;
import com.jungle.base.domain.bo.BaseUserBo;
import com.jungle.base.service.AbstractService;
import com.jungle.bfi.domain.bo.BizSceneBo;
import com.jungle.bfi.entity.BizScenePo;
import com.jungle.bfi.service.biz.BizSceneService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.n3r.idworker.Sid;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class BizSceneServiceImpl extends AbstractService<BizScenePo, BizSceneBo, String> implements BizSceneService {
    @Resource
    private Mapper mapper;

    @Override
    protected String getBoId(BizSceneBo bo) {
        return bo.getId();
    }

    @Override
    protected String newPoId() {
        return Sid.nextShort();
    }

    @Override
    protected BizScenePo createPo(BizSceneBo bo, BaseUserBo userBo) {
        return mapper.map(bo, BizScenePo.class);
    }

    @Override
    protected void updatePo(BizSceneBo bo, BaseUserBo userBo, BizScenePo po) {
        mapper.map(bo, po);
    }
}
